<?php //e($javascript->codeBlock('$(document).ready(function() {$("#PostAddForm").ajaxForm(function() {$(".content").load("/admin/posts");});});'));?>
<?php e($this->renderElement('tinymce'));?>

<div id="post">
	<?php e($form->create('Post'));?>
		<fieldset id="post-add">
			<legend>Add a new post</legend>
		<?php e($form->input('title'));?>
		<?php e($form->input('byline'));?>
		<?php e($form->input('subject_id', array('options' => $subject)));?>
		<?php e($form->input('copyright_id', array('options' => $copyright_type)));?>
		<?php e($form->input('body'));?>
		<?php if($othAuth->group('name') == "Site Admins") {
				e($form->input('published', array('label'=>'Publish Story?')));
			} else {
				e($form->input('published', array('type'=>'hidden', 'value'=>0)));
			}
		?>
		<?php e($form->input('user_id', array('type'=>'hidden', 'value'=>$author_id)));?>
		</fieldset>
		
		<?php e($form->submit('Submit Post'));?> <?php e($html->link('Cancel', '/admin/posts', array('class'=>'cancel')));?>
	<?php e($form->end());?>
</div>